<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
<div id="app">
	<div>{{ title }}</div>
	<input v-model="num" type="number"><button v-on:click="zz">自增</button>
	<hr>
	<div>{{ title2 }}</div>
	<input v-model="num1" type="number"><span>+</span><input type="number" v-model="num2">
	<button v-on:click="add">=</button><strong>{{ sum }}</strong>
</div>
<script src="node_modules/vue/dist/vue.min.js"></script>
<script>
	var app = new Vue({
		el:'#app',
		data:{
			title:'自增',
			title2:'加法演示',
			num:0,
			num1:0,
			num2:0,
			sum:0
		},
		methods:{
			zz:function(){
				this.num++
			},
			add:function(){
				this.sum = (this.num1-0)+(this.num2-0)
			}
		}
	})
</script>
</body>
</html>